package com.example.lib_cache.model;
import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;
import androidx.databinding.library.baseAdapters.BR;

import com.alibaba.fastjson.annotation.JSONField;

import java.util.Date;


public class User extends BaseObservable{
    //用户id
    private Long id;
    //账号
    private String account;
    //密码
    private String password;
    //昵称
    private String nickname;
    //手机号码
    private String phoneNumber;


    //注册时间
    private Date registerTime;
    //最近登录
    private Date loginTime;
    //是否是司机
    private Integer isDriver;

    public User(String account,String password){
        this.account = account;
        this.password = password;
    }

    public User(Long id, String account, String password, String nickname, String phoneNumber, Date registerTime, Date loginTime, Integer isDriver) {
        this.id = id;
        this.account = account;
        this.password = password;
        this.nickname = nickname;
        this.phoneNumber = phoneNumber;
        this.registerTime = registerTime;
        this.loginTime = loginTime;
        this.isDriver = isDriver;
    }

    @Bindable
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Bindable
    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
        notifyPropertyChanged(BR.account);
    }

    @Bindable
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
        notifyPropertyChanged(BR.password);
    }

    @Bindable
    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    @Bindable
    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    @Bindable
    public Date getRegisterTime() {
        return registerTime;
    }

    public void setRegisterTime(Date registerTime) {
        this.registerTime = registerTime;
    }

    @Bindable
    public Date getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Date loginTime) {
        this.loginTime = loginTime;
    }

    public Integer getIsDriver() {
        return isDriver;
    }

    public void setIsDriver(Integer isDriver) {
        this.isDriver = isDriver;
    }
}
